
#include "stdafx.h"
#include "Fugue.h"

namespace Fugue
{
    void Fugue256Base::TransformBytes_(byte* a_data, int a_index, int a_length)
    {
        a_data += a_index;
        a_length = a_length/4;

        ulong row0, row1, row2, row3;
        ulong col0, col1, col2, col3;
        ulong col_0,col_1,col_2,col_3,col_02,col_13;
        ulong tmp, tmp_in;
        uint tmp_zero;
        int ptr = m_base;
        int j = 0;
        uint j1 = (5-m_base/6)%5;

        tmp_zero = m_state[(ptr+60)%30];

        if ((j1 != 0)&& (a_length != 0))
        {
            if  (j1 <= 1)         
            { 
                m_state[((-6*1)+10+60)%30] ^= tmp_zero;
                m_state[((-6*1)+60)%30] = ((uint*)a_data)[j];
                m_state[((-6*1)+8+60)%30] ^= m_state[((-6*1)+60)%30];
                m_state[((-6*1)+1+60)%30] ^= m_state[((-6*1)+24+60)%30];
                m_state[((-3*(2*1+1))+60)%30] ^= m_state[((-3*(2*1+1))+4+60)%30];
                m_state[((-3*(2*1+1))+1+60)%30] ^= m_state[((-3*(2*1+1))+5+60)%30];
                m_state[((-3*(2*1+1))+2+60)%30] ^= m_state[((-3*(2*1+1))+6+60)%30];
                m_state[((-3*(2*1+1))+15+60)%30] ^= m_state[((-3*(2*1+1))+4+60)%30];
                m_state[((-3*(2*1+1))+16+60)%30] ^= m_state[((-3*(2*1+1))+5+60)%30];
                m_state[((-3*(2*1+1))+17+60)%30] ^= m_state[((-3*(2*1+1))+6+60)%30];
                row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*1+1))+3+60)%30])];
                col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*1+1))+3+60)%30]>>8)];
                col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*1+1))+3+60)%30]>>16)];
                col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*1+1))+3+60)%30]>>24)];
                col0 = aes_style_table0[(byte)(m_state[((-3*(2*1+1))+60)%30])];
                tmp = aes_style_table1[(byte)(m_state[((-3*(2*1+1))+60)%30]>>8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = aes_style_table2[(byte)(m_state[((-3*(2*1+1))+60)%30]>>16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*1+1))+60)%30]>>24)];
                row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*1+1))+1+60)%30])];
                col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*1+1))+1+60)%30]>>8)];
                tmp = aes_style_table2[(byte)(m_state[((-3*(2*1+1))+1+60)%30]>>16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = aes_style_table3[(byte)(m_state[((-3*(2*1+1))+1+60)%30]>>24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*1+1))+2+60)%30])];
                tmp = aes_style_table1[(byte)(m_state[((-3*(2*1+1))+2+60)%30]>>8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*1+1))+2+60)%30]>>16)];
                tmp = aes_style_table3[(byte)(m_state[((-3*(2*1+1))+2+60)%30]>>24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0^((ulong)col2<<32);
                col_1 = (uint)col1^((ulong)col3<<32);
                col_2 = (uint)col2^((ulong)col0<<32);
                col_3 = (uint)col3^((ulong)col1<<32);
                col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
                row0=row0>>8;
                row1=row1>>8;
                row2=row2>>8;
                row3=row3<<24;
                col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
                tmp_zero = (uint) col_02;
                m_state[((-3*(2*1+1))+2+60)%30] = (uint)(col_02>>32);
                m_state[((-3*(2*1+1))+1+60)%30] = (uint)col_13;
                m_state[((-3*(2*1+1))+3+60)%30] = (uint)(col_13>>32);
                m_state[((-3*(2*1+1))+60)%30] = tmp_zero;
                m_state[((-3*(2*1+2))+60)%30] ^= m_state[((-3*(2*1+2))+4+60)%30];
                m_state[((-3*(2*1+2))+1+60)%30] ^= m_state[((-3*(2*1+2))+5+60)%30];
                m_state[((-3*(2*1+2))+2+60)%30] ^= m_state[((-3*(2*1+2))+6+60)%30];
                m_state[((-3*(2*1+2))+15+60)%30] ^= m_state[((-3*(2*1+2))+4+60)%30];
                m_state[((-3*(2*1+2))+16+60)%30] ^= m_state[((-3*(2*1+2))+5+60)%30];
                m_state[((-3*(2*1+2))+17+60)%30] ^= m_state[((-3*(2*1+2))+6+60)%30];
                row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*1+2))+3+60)%30])];
                col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*1+2))+3+60)%30]>>8)];
                col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*1+2))+3+60)%30]>>16)];
                col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*1+2))+3+60)%30]>>24)];
                col0 = aes_style_table0[(byte)(m_state[((-3*(2*1+2))+60)%30])];
                tmp = aes_style_table1[(byte)(m_state[((-3*(2*1+2))+60)%30]>>8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = aes_style_table2[(byte)(m_state[((-3*(2*1+2))+60)%30]>>16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*1+2))+60)%30]>>24)];
                row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*1+2))+1+60)%30])];
                col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*1+2))+1+60)%30]>>8)];
                tmp = aes_style_table2[(byte)(m_state[((-3*(2*1+2))+1+60)%30]>>16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = aes_style_table3[(byte)(m_state[((-3*(2*1+2))+1+60)%30]>>24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*1+2))+2+60)%30])];
                tmp = aes_style_table1[(byte)(m_state[((-3*(2*1+2))+2+60)%30]>>8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*1+2))+2+60)%30]>>16)];
                tmp = aes_style_table3[(byte)(m_state[((-3*(2*1+2))+2+60)%30]>>24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0^((ulong)col2<<32);
                col_1 = (uint)col1^((ulong)col3<<32);
                col_2 = (uint)col2^((ulong)col0<<32);
                col_3 = (uint)col3^((ulong)col1<<32);
                col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
                row0=row0>>8;
                row1=row1>>8;
                row2=row2>>8;
                row3=row3<<24;
                col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
                tmp_zero = (uint) col_02;
                m_state[((-3*(2*1+2))+2+60)%30] = (uint)(col_02>>32);
                m_state[((-3*(2*1+2))+1+60)%30] = (uint)col_13;
                m_state[((-3*(2*1+2))+3+60)%30] = (uint)(col_13>>32);

                j++;
                a_length--;
                ptr -= 6;
            }

            if ((j1 <=2)&& (a_length != 0))
            { 
                m_state[((-6*2)+10+60)%30] ^= tmp_zero;
                m_state[((-6*2)+60)%30] = ((uint*)a_data)[j];
                m_state[((-6*2)+8+60)%30] ^= m_state[((-6*2)+60)%30];
                m_state[((-6*2)+1+60)%30] ^= m_state[((-6*2)+24+60)%30];
                m_state[((-3*(2*2+1))+60)%30] ^= m_state[((-3*(2*2+1))+4+60)%30];
                m_state[((-3*(2*2+1))+1+60)%30] ^= m_state[((-3*(2*2+1))+5+60)%30];
                m_state[((-3*(2*2+1))+2+60)%30] ^= m_state[((-3*(2*2+1))+6+60)%30];
                m_state[((-3*(2*2+1))+15+60)%30] ^= m_state[((-3*(2*2+1))+4+60)%30];
                m_state[((-3*(2*2+1))+16+60)%30] ^= m_state[((-3*(2*2+1))+5+60)%30];
                m_state[((-3*(2*2+1))+17+60)%30] ^= m_state[((-3*(2*2+1))+6+60)%30];
                row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*2+1))+3+60)%30])];
                col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*2+1))+3+60)%30]>>8)];
                col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*2+1))+3+60)%30]>>16)];
                col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*2+1))+3+60)%30]>>24)];
                col0 = aes_style_table0[(byte)(m_state[((-3*(2*2+1))+60)%30])];
                tmp = aes_style_table1[(byte)(m_state[((-3*(2*2+1))+60)%30]>>8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = aes_style_table2[(byte)(m_state[((-3*(2*2+1))+60)%30]>>16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*2+1))+60)%30]>>24)];
                row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*2+1))+1+60)%30])];
                col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*2+1))+1+60)%30]>>8)];
                tmp = aes_style_table2[(byte)(m_state[((-3*(2*2+1))+1+60)%30]>>16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = aes_style_table3[(byte)(m_state[((-3*(2*2+1))+1+60)%30]>>24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*2+1))+2+60)%30])];
                tmp = aes_style_table1[(byte)(m_state[((-3*(2*2+1))+2+60)%30]>>8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*2+1))+2+60)%30]>>16)];
                tmp = aes_style_table3[(byte)(m_state[((-3*(2*2+1))+2+60)%30]>>24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0^((ulong)col2<<32);
                col_1 = (uint)col1^((ulong)col3<<32);
                col_2 = (uint)col2^((ulong)col0<<32);
                col_3 = (uint)col3^((ulong)col1<<32);
                col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
                row0=row0>>8;
                row1=row1>>8;
                row2=row2>>8;
                row3=row3<<24;
                col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
                tmp_zero = (uint) col_02;
                m_state[((-3*(2*2+1))+2+60)%30] = (uint)(col_02>>32);
                m_state[((-3*(2*2+1))+1+60)%30] = (uint)col_13;
                m_state[((-3*(2*2+1))+3+60)%30] = (uint)(col_13>>32);
                m_state[((-3*(2*2+1))+60)%30] = tmp_zero;
                m_state[((-3*(2*2+2))+60)%30] ^= m_state[((-3*(2*2+2))+4+60)%30];
                m_state[((-3*(2*2+2))+1+60)%30] ^= m_state[((-3*(2*2+2))+5+60)%30];
                m_state[((-3*(2*2+2))+2+60)%30] ^= m_state[((-3*(2*2+2))+6+60)%30];
                m_state[((-3*(2*2+2))+15+60)%30] ^= m_state[((-3*(2*2+2))+4+60)%30];
                m_state[((-3*(2*2+2))+16+60)%30] ^= m_state[((-3*(2*2+2))+5+60)%30];
                m_state[((-3*(2*2+2))+17+60)%30] ^= m_state[((-3*(2*2+2))+6+60)%30];
                row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*2+2))+3+60)%30])];
                col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*2+2))+3+60)%30]>>8)];
                col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*2+2))+3+60)%30]>>16)];
                col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*2+2))+3+60)%30]>>24)];
                col0 = aes_style_table0[(byte)(m_state[((-3*(2*2+2))+60)%30])];
                tmp = aes_style_table1[(byte)(m_state[((-3*(2*2+2))+60)%30]>>8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = aes_style_table2[(byte)(m_state[((-3*(2*2+2))+60)%30]>>16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*2+2))+60)%30]>>24)];
                row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*2+2))+1+60)%30])];
                col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*2+2))+1+60)%30]>>8)];
                tmp = aes_style_table2[(byte)(m_state[((-3*(2*2+2))+1+60)%30]>>16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = aes_style_table3[(byte)(m_state[((-3*(2*2+2))+1+60)%30]>>24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*2+2))+2+60)%30])];
                tmp = aes_style_table1[(byte)(m_state[((-3*(2*2+2))+2+60)%30]>>8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*2+2))+2+60)%30]>>16)];
                tmp = aes_style_table3[(byte)(m_state[((-3*(2*2+2))+2+60)%30]>>24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0^((ulong)col2<<32);
                col_1 = (uint)col1^((ulong)col3<<32);
                col_2 = (uint)col2^((ulong)col0<<32);
                col_3 = (uint)col3^((ulong)col1<<32);
                col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
                row0=row0>>8;
                row1=row1>>8;
                row2=row2>>8;
                row3=row3<<24;
                col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
                tmp_zero = (uint) col_02;
                m_state[((-3*(2*2+2))+2+60)%30] = (uint)(col_02>>32);
                m_state[((-3*(2*2+2))+1+60)%30] = (uint)col_13;
                m_state[((-3*(2*2+2))+3+60)%30] = (uint)(col_13>>32);

                j++;
                a_length--;
                ptr -= 6;
            }

            if ((j1 <=3)&& (a_length != 0)) 
            { 
                m_state[((-6*3)+10+60)%30] ^= tmp_zero;
                m_state[((-6*3)+60)%30] = ((uint*)a_data)[j];
                m_state[((-6*3)+8+60)%30] ^= m_state[((-6*3)+60)%30];
                m_state[((-6*3)+1+60)%30] ^= m_state[((-6*3)+24+60)%30];
                m_state[((-3*(2*3+1))+60)%30] ^= m_state[((-3*(2*3+1))+4+60)%30];
                m_state[((-3*(2*3+1))+1+60)%30] ^= m_state[((-3*(2*3+1))+5+60)%30];
                m_state[((-3*(2*3+1))+2+60)%30] ^= m_state[((-3*(2*3+1))+6+60)%30];
                m_state[((-3*(2*3+1))+15+60)%30] ^= m_state[((-3*(2*3+1))+4+60)%30];
                m_state[((-3*(2*3+1))+16+60)%30] ^= m_state[((-3*(2*3+1))+5+60)%30];
                m_state[((-3*(2*3+1))+17+60)%30] ^= m_state[((-3*(2*3+1))+6+60)%30];
                row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*3+1))+3+60)%30])];
                col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*3+1))+3+60)%30]>>8)];
                col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*3+1))+3+60)%30]>>16)];
                col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*3+1))+3+60)%30]>>24)];
                col0 = aes_style_table0[(byte)(m_state[((-3*(2*3+1))+60)%30])];
                tmp = aes_style_table1[(byte)(m_state[((-3*(2*3+1))+60)%30]>>8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = aes_style_table2[(byte)(m_state[((-3*(2*3+1))+60)%30]>>16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*3+1))+60)%30]>>24)];
                row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*3+1))+1+60)%30])];
                col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*3+1))+1+60)%30]>>8)];
                tmp = aes_style_table2[(byte)(m_state[((-3*(2*3+1))+1+60)%30]>>16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = aes_style_table3[(byte)(m_state[((-3*(2*3+1))+1+60)%30]>>24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*3+1))+2+60)%30])];
                tmp = aes_style_table1[(byte)(m_state[((-3*(2*3+1))+2+60)%30]>>8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*3+1))+2+60)%30]>>16)];
                tmp = aes_style_table3[(byte)(m_state[((-3*(2*3+1))+2+60)%30]>>24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0^((ulong)col2<<32);
                col_1 = (uint)col1^((ulong)col3<<32);
                col_2 = (uint)col2^((ulong)col0<<32);
                col_3 = (uint)col3^((ulong)col1<<32);
                col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
                row0=row0>>8;
                row1=row1>>8;
                row2=row2>>8;
                row3=row3<<24;
                col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
                tmp_zero = (uint) col_02;
                m_state[((-3*(2*3+1))+2+60)%30] = (uint)(col_02>>32);
                m_state[((-3*(2*3+1))+1+60)%30] = (uint)col_13;
                m_state[((-3*(2*3+1))+3+60)%30] = (uint)(col_13>>32);
                m_state[((-3*(2*3+1))+60)%30] = tmp_zero;
                m_state[((-3*(2*3+2))+60)%30] ^= m_state[((-3*(2*3+2))+4+60)%30];
                m_state[((-3*(2*3+2))+1+60)%30] ^= m_state[((-3*(2*3+2))+5+60)%30];
                m_state[((-3*(2*3+2))+2+60)%30] ^= m_state[((-3*(2*3+2))+6+60)%30];
                m_state[((-3*(2*3+2))+15+60)%30] ^= m_state[((-3*(2*3+2))+4+60)%30];
                m_state[((-3*(2*3+2))+16+60)%30] ^= m_state[((-3*(2*3+2))+5+60)%30];
                m_state[((-3*(2*3+2))+17+60)%30] ^= m_state[((-3*(2*3+2))+6+60)%30];
                row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*3+2))+3+60)%30])];
                col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*3+2))+3+60)%30]>>8)];
                col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*3+2))+3+60)%30]>>16)];
                col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*3+2))+3+60)%30]>>24)];
                col0 = aes_style_table0[(byte)(m_state[((-3*(2*3+2))+60)%30])];
                tmp = aes_style_table1[(byte)(m_state[((-3*(2*3+2))+60)%30]>>8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = aes_style_table2[(byte)(m_state[((-3*(2*3+2))+60)%30]>>16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*3+2))+60)%30]>>24)];
                row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*3+2))+1+60)%30])];
                col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*3+2))+1+60)%30]>>8)];
                tmp = aes_style_table2[(byte)(m_state[((-3*(2*3+2))+1+60)%30]>>16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = aes_style_table3[(byte)(m_state[((-3*(2*3+2))+1+60)%30]>>24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*3+2))+2+60)%30])];
                tmp = aes_style_table1[(byte)(m_state[((-3*(2*3+2))+2+60)%30]>>8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*3+2))+2+60)%30]>>16)];
                tmp = aes_style_table3[(byte)(m_state[((-3*(2*3+2))+2+60)%30]>>24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0^((ulong)col2<<32);
                col_1 = (uint)col1^((ulong)col3<<32);
                col_2 = (uint)col2^((ulong)col0<<32);
                col_3 = (uint)col3^((ulong)col1<<32);
                col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
                row0=row0>>8;
                row1=row1>>8;
                row2=row2>>8;
                row3=row3<<24;
                col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
                tmp_zero = (uint) col_02;
                m_state[((-3*(2*3+2))+2+60)%30] = (uint)(col_02>>32);
                m_state[((-3*(2*3+2))+1+60)%30] = (uint)col_13;
                m_state[((-3*(2*3+2))+3+60)%30] = (uint)(col_13>>32);

                j++;
                a_length--;
                ptr -= 6;
            }

            if ((j1 <=4)&& (a_length != 0)) 
            { 
                m_state[((-6*4)+10+60)%30] ^= tmp_zero;
                m_state[((-6*4)+60)%30] = ((uint*)a_data)[j];
                m_state[((-6*4)+8+60)%30] ^= m_state[((-6*4)+60)%30];
                m_state[((-6*4)+1+60)%30] ^= m_state[((-6*4)+24+60)%30];
                m_state[((-3*(2*4+1))+60)%30] ^= m_state[((-3*(2*4+1))+4+60)%30];
                m_state[((-3*(2*4+1))+1+60)%30] ^= m_state[((-3*(2*4+1))+5+60)%30];
                m_state[((-3*(2*4+1))+2+60)%30] ^= m_state[((-3*(2*4+1))+6+60)%30];
                m_state[((-3*(2*4+1))+15+60)%30] ^= m_state[((-3*(2*4+1))+4+60)%30];
                m_state[((-3*(2*4+1))+16+60)%30] ^= m_state[((-3*(2*4+1))+5+60)%30];
                m_state[((-3*(2*4+1))+17+60)%30] ^= m_state[((-3*(2*4+1))+6+60)%30];
                row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*4+1))+3+60)%30])];
                col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*4+1))+3+60)%30]>>8)];
                col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*4+1))+3+60)%30]>>16)];
                col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*4+1))+3+60)%30]>>24)];
                col0 = aes_style_table0[(byte)(m_state[((-3*(2*4+1))+60)%30])];
                tmp = aes_style_table1[(byte)(m_state[((-3*(2*4+1))+60)%30]>>8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = aes_style_table2[(byte)(m_state[((-3*(2*4+1))+60)%30]>>16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*4+1))+60)%30]>>24)];
                row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*4+1))+1+60)%30])];
                col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*4+1))+1+60)%30]>>8)];
                tmp = aes_style_table2[(byte)(m_state[((-3*(2*4+1))+1+60)%30]>>16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = aes_style_table3[(byte)(m_state[((-3*(2*4+1))+1+60)%30]>>24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*4+1))+2+60)%30])];
                tmp = aes_style_table1[(byte)(m_state[((-3*(2*4+1))+2+60)%30]>>8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*4+1))+2+60)%30]>>16)];
                tmp = aes_style_table3[(byte)(m_state[((-3*(2*4+1))+2+60)%30]>>24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0^((ulong)col2<<32);
                col_1 = (uint)col1^((ulong)col3<<32);
                col_2 = (uint)col2^((ulong)col0<<32);
                col_3 = (uint)col3^((ulong)col1<<32);
                col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
                row0=row0>>8;
                row1=row1>>8;
                row2=row2>>8;
                row3=row3<<24;
                col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
                tmp_zero = (uint) col_02;
                m_state[((-3*(2*4+1))+2+60)%30] = (uint)(col_02>>32);
                m_state[((-3*(2*4+1))+1+60)%30] = (uint)col_13;
                m_state[((-3*(2*4+1))+3+60)%30] = (uint)(col_13>>32);
                m_state[((-3*(2*4+1))+60)%30] = tmp_zero;
                m_state[((-3*(2*4+2))+60)%30] ^= m_state[((-3*(2*4+2))+4+60)%30];
                m_state[((-3*(2*4+2))+1+60)%30] ^= m_state[((-3*(2*4+2))+5+60)%30];
                m_state[((-3*(2*4+2))+2+60)%30] ^= m_state[((-3*(2*4+2))+6+60)%30];
                m_state[((-3*(2*4+2))+15+60)%30] ^= m_state[((-3*(2*4+2))+4+60)%30];
                m_state[((-3*(2*4+2))+16+60)%30] ^= m_state[((-3*(2*4+2))+5+60)%30];
                m_state[((-3*(2*4+2))+17+60)%30] ^= m_state[((-3*(2*4+2))+6+60)%30];
                row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*4+2))+3+60)%30])];
                col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*4+2))+3+60)%30]>>8)];
                col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*4+2))+3+60)%30]>>16)];
                col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*4+2))+3+60)%30]>>24)];
                col0 = aes_style_table0[(byte)(m_state[((-3*(2*4+2))+60)%30])];
                tmp = aes_style_table1[(byte)(m_state[((-3*(2*4+2))+60)%30]>>8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = aes_style_table2[(byte)(m_state[((-3*(2*4+2))+60)%30]>>16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*4+2))+60)%30]>>24)];
                row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*4+2))+1+60)%30])];
                col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*4+2))+1+60)%30]>>8)];
                tmp = aes_style_table2[(byte)(m_state[((-3*(2*4+2))+1+60)%30]>>16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = aes_style_table3[(byte)(m_state[((-3*(2*4+2))+1+60)%30]>>24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*4+2))+2+60)%30])];
                tmp = aes_style_table1[(byte)(m_state[((-3*(2*4+2))+2+60)%30]>>8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*4+2))+2+60)%30]>>16)];
                tmp = aes_style_table3[(byte)(m_state[((-3*(2*4+2))+2+60)%30]>>24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0^((ulong)col2<<32);
                col_1 = (uint)col1^((ulong)col3<<32);
                col_2 = (uint)col2^((ulong)col0<<32);
                col_3 = (uint)col3^((ulong)col1<<32);
                col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
                row0=row0>>8;
                row1=row1>>8;
                row2=row2>>8;
                row3=row3<<24;
                col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
                tmp_zero = (uint) col_02;
                m_state[((-3*(2*4+2))+2+60)%30] = (uint)(col_02>>32);
                m_state[((-3*(2*4+2))+1+60)%30] = (uint)col_13;
                m_state[((-3*(2*4+2))+3+60)%30] = (uint)(col_13>>32);

                j++;
                a_length--;
                ptr -= 6;
            }
        }

        int len_mod = (a_length)%10;
        int len_div = (a_length)/10;

        for (int j2=0; j2<len_div; j2++)
        {
            tmp_in = *(ulong*)&((uint*)a_data)[j];
            m_state[(-6*0+1+60)%30] ^= m_state[(-6*0+24+60)%30];
            m_state[(-6*0+10+60)%30] ^= tmp_zero;
            m_state[(-6*0+8+60)%30] ^= m_state[(-6*0+60)%30] = (uint) tmp_in;
            m_state[(-6*0-3+60)%30] ^= m_state[(-6*0+1+60)%30];
            m_state[(-6*0-2+60)%30] ^= m_state[(-6*0+2+60)%30];
            m_state[(-6*0-1+60)%30] ^= m_state[(-6*0+3+60)%30];
            m_state[(-6*0+12+60)%30] ^= m_state[(-6*0+1+60)%30];
            m_state[(-6*0+13+60)%30] ^= m_state[(-6*0+2+60)%30];
            m_state[(-6*0+14+60)%30] ^= m_state[(-6*0+3+60)%30];
            tmp_in = (uint) (tmp_in >>32);
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*0+1))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*0+1))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*0+1))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*0+1))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*0+1))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*0+1))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*0+1))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*0+1))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*0+1))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*0+1))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*0+1))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*0+1))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*0+1))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*0+1))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*0+1))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*0+1))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*0+1))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*0+1))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*0+1))+3+60)%30] = (uint)(col_13>>32);
            m_state[((-3*(2*0+1))+60)%30] = tmp_zero;
            m_state[((-3*(2*0+2))+60)%30] ^= m_state[((-3*(2*0+2))+4+60)%30];
            m_state[((-3*(2*0+2))+1+60)%30] ^= m_state[((-3*(2*0+2))+5+60)%30];
            m_state[((-3*(2*0+2))+2+60)%30] ^= m_state[((-3*(2*0+2))+6+60)%30];
            m_state[((-3*(2*0+2))+15+60)%30] ^= m_state[((-3*(2*0+2))+4+60)%30];
            m_state[((-3*(2*0+2))+16+60)%30] ^= m_state[((-3*(2*0+2))+5+60)%30];
            m_state[((-3*(2*0+2))+17+60)%30] ^= m_state[((-3*(2*0+2))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*0+2))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*0+2))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*0+2))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*0+2))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*0+2))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*0+2))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*0+2))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*0+2))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*0+2))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*0+2))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*0+2))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*0+2))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*0+2))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*0+2))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*0+2))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*0+2))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*0+2))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*0+2))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*0+2))+3+60)%30] = (uint)(col_13>>32);

            j++;

            m_state[(-6*1+8+60)%30] ^= m_state[(-6*1+60)%30] = (uint)(tmp_in);
            m_state[(-6*1+10+60)%30] ^= tmp_zero;
            m_state[(-6*1+1+60)%30] ^= m_state[(-6*1+24+60)%30];
            m_state[((-3*(2*1+1))+60)%30] ^= m_state[((-3*(2*1+1))+4+60)%30];
            m_state[((-3*(2*1+1))+1+60)%30] ^= m_state[((-3*(2*1+1))+5+60)%30];
            m_state[((-3*(2*1+1))+2+60)%30] ^= m_state[((-3*(2*1+1))+6+60)%30];
            m_state[((-3*(2*1+1))+15+60)%30] ^= m_state[((-3*(2*1+1))+4+60)%30];
            m_state[((-3*(2*1+1))+16+60)%30] ^= m_state[((-3*(2*1+1))+5+60)%30];
            m_state[((-3*(2*1+1))+17+60)%30] ^= m_state[((-3*(2*1+1))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*1+1))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*1+1))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*1+1))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*1+1))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*1+1))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*1+1))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*1+1))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*1+1))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*1+1))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*1+1))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*1+1))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*1+1))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*1+1))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*1+1))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*1+1))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*1+1))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*1+1))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*1+1))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*1+1))+3+60)%30] = (uint)(col_13>>32);
            m_state[((-3*(2*1+1))+60)%30] = tmp_zero;
            m_state[((-3*(2*1+2))+60)%30] ^= m_state[((-3*(2*1+2))+4+60)%30];
            m_state[((-3*(2*1+2))+1+60)%30] ^= m_state[((-3*(2*1+2))+5+60)%30];
            m_state[((-3*(2*1+2))+2+60)%30] ^= m_state[((-3*(2*1+2))+6+60)%30];
            m_state[((-3*(2*1+2))+15+60)%30] ^= m_state[((-3*(2*1+2))+4+60)%30];
            m_state[((-3*(2*1+2))+16+60)%30] ^= m_state[((-3*(2*1+2))+5+60)%30];
            m_state[((-3*(2*1+2))+17+60)%30] ^= m_state[((-3*(2*1+2))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*1+2))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*1+2))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*1+2))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*1+2))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*1+2))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*1+2))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*1+2))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*1+2))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*1+2))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*1+2))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*1+2))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*1+2))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*1+2))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*1+2))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*1+2))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*1+2))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*1+2))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*1+2))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*1+2))+3+60)%30] = (uint)(col_13>>32);

            j++;

            tmp_in = *(ulong*)&((uint*)a_data)[j];
            m_state[(-6*2+1+60)%30] ^= m_state[(-6*2+24+60)%30];
            m_state[(-6*2+10+60)%30] ^= tmp_zero;
            m_state[(-6*2+8+60)%30] ^= m_state[(-6*2+60)%30] = (uint) tmp_in;
            m_state[(-6*2-3+60)%30] ^= m_state[(-6*2+1+60)%30];
            m_state[(-6*2-2+60)%30] ^= m_state[(-6*2+2+60)%30];
            m_state[(-6*2-1+60)%30] ^= m_state[(-6*2+3+60)%30];
            m_state[(-6*2+12+60)%30] ^= m_state[(-6*2+1+60)%30];
            m_state[(-6*2+13+60)%30] ^= m_state[(-6*2+2+60)%30];
            m_state[(-6*2+14+60)%30] ^= m_state[(-6*2+3+60)%30];
            tmp_in = (uint) (tmp_in >>32);
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*2+1))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*2+1))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*2+1))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*2+1))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*2+1))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*2+1))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*2+1))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*2+1))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*2+1))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*2+1))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*2+1))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*2+1))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*2+1))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*2+1))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*2+1))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*2+1))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*2+1))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*2+1))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*2+1))+3+60)%30] = (uint)(col_13>>32);
            m_state[((-3*(2*2+1))+60)%30] = tmp_zero;
            m_state[((-3*(2*2+2))+60)%30] ^= m_state[((-3*(2*2+2))+4+60)%30];
            m_state[((-3*(2*2+2))+1+60)%30] ^= m_state[((-3*(2*2+2))+5+60)%30];
            m_state[((-3*(2*2+2))+2+60)%30] ^= m_state[((-3*(2*2+2))+6+60)%30];
            m_state[((-3*(2*2+2))+15+60)%30] ^= m_state[((-3*(2*2+2))+4+60)%30];
            m_state[((-3*(2*2+2))+16+60)%30] ^= m_state[((-3*(2*2+2))+5+60)%30];
            m_state[((-3*(2*2+2))+17+60)%30] ^= m_state[((-3*(2*2+2))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*2+2))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*2+2))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*2+2))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*2+2))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*2+2))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*2+2))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*2+2))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*2+2))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*2+2))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*2+2))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*2+2))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*2+2))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*2+2))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*2+2))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*2+2))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*2+2))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*2+2))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*2+2))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*2+2))+3+60)%30] = (uint)(col_13>>32);

            j++;

            m_state[(-6*3+8+60)%30] ^= m_state[(-6*3+60)%30] = (uint)(tmp_in);
            m_state[(-6*3+10+60)%30] ^= tmp_zero;
            m_state[(-6*3+1+60)%30] ^= m_state[(-6*3+24+60)%30];
            m_state[((-3*(2*3+1))+60)%30] ^= m_state[((-3*(2*3+1))+4+60)%30];
            m_state[((-3*(2*3+1))+1+60)%30] ^= m_state[((-3*(2*3+1))+5+60)%30];
            m_state[((-3*(2*3+1))+2+60)%30] ^= m_state[((-3*(2*3+1))+6+60)%30];
            m_state[((-3*(2*3+1))+15+60)%30] ^= m_state[((-3*(2*3+1))+4+60)%30];
            m_state[((-3*(2*3+1))+16+60)%30] ^= m_state[((-3*(2*3+1))+5+60)%30];
            m_state[((-3*(2*3+1))+17+60)%30] ^= m_state[((-3*(2*3+1))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*3+1))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*3+1))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*3+1))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*3+1))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*3+1))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*3+1))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*3+1))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*3+1))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*3+1))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*3+1))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*3+1))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*3+1))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*3+1))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*3+1))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*3+1))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*3+1))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*3+1))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*3+1))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*3+1))+3+60)%30] = (uint)(col_13>>32);
            m_state[((-3*(2*3+1))+60)%30] = tmp_zero;
            m_state[((-3*(2*3+2))+60)%30] ^= m_state[((-3*(2*3+2))+4+60)%30];
            m_state[((-3*(2*3+2))+1+60)%30] ^= m_state[((-3*(2*3+2))+5+60)%30];
            m_state[((-3*(2*3+2))+2+60)%30] ^= m_state[((-3*(2*3+2))+6+60)%30];
            m_state[((-3*(2*3+2))+15+60)%30] ^= m_state[((-3*(2*3+2))+4+60)%30];
            m_state[((-3*(2*3+2))+16+60)%30] ^= m_state[((-3*(2*3+2))+5+60)%30];
            m_state[((-3*(2*3+2))+17+60)%30] ^= m_state[((-3*(2*3+2))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*3+2))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*3+2))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*3+2))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*3+2))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*3+2))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*3+2))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*3+2))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*3+2))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*3+2))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*3+2))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*3+2))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*3+2))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*3+2))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*3+2))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*3+2))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*3+2))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*3+2))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*3+2))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*3+2))+3+60)%30] = (uint)(col_13>>32);

            j++;

            tmp_in = *(ulong*)&((uint*)a_data)[j];
            m_state[(-6*4+1+60)%30] ^= m_state[(-6*4+24+60)%30];
            m_state[(-6*4+10+60)%30] ^= tmp_zero;
            m_state[(-6*4+8+60)%30] ^= m_state[(-6*4+60)%30] = (uint) tmp_in;
            m_state[(-6*4-3+60)%30] ^= m_state[(-6*4+1+60)%30];
            m_state[(-6*4-2+60)%30] ^= m_state[(-6*4+2+60)%30];
            m_state[(-6*4-1+60)%30] ^= m_state[(-6*4+3+60)%30];
            m_state[(-6*4+12+60)%30] ^= m_state[(-6*4+1+60)%30];
            m_state[(-6*4+13+60)%30] ^= m_state[(-6*4+2+60)%30];
            m_state[(-6*4+14+60)%30] ^= m_state[(-6*4+3+60)%30];
            tmp_in = (uint) (tmp_in >>32);
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*4+1))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*4+1))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*4+1))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*4+1))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*4+1))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*4+1))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*4+1))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*4+1))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*4+1))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*4+1))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*4+1))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*4+1))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*4+1))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*4+1))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*4+1))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*4+1))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*4+1))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*4+1))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*4+1))+3+60)%30] = (uint)(col_13>>32);
            m_state[((-3*(2*4+1))+60)%30] = tmp_zero;
            m_state[((-3*(2*4+2))+60)%30] ^= m_state[((-3*(2*4+2))+4+60)%30];
            m_state[((-3*(2*4+2))+1+60)%30] ^= m_state[((-3*(2*4+2))+5+60)%30];
            m_state[((-3*(2*4+2))+2+60)%30] ^= m_state[((-3*(2*4+2))+6+60)%30];
            m_state[((-3*(2*4+2))+15+60)%30] ^= m_state[((-3*(2*4+2))+4+60)%30];
            m_state[((-3*(2*4+2))+16+60)%30] ^= m_state[((-3*(2*4+2))+5+60)%30];
            m_state[((-3*(2*4+2))+17+60)%30] ^= m_state[((-3*(2*4+2))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*4+2))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*4+2))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*4+2))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*4+2))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*4+2))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*4+2))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*4+2))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*4+2))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*4+2))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*4+2))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*4+2))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*4+2))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*4+2))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*4+2))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*4+2))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*4+2))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*4+2))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*4+2))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*4+2))+3+60)%30] = (uint)(col_13>>32);

            j++;

            m_state[(-6*0+8+60)%30] ^= m_state[(-6*0+60)%30] = (uint)(tmp_in);
            m_state[(-6*0+10+60)%30] ^= tmp_zero;
            m_state[(-6*0+1+60)%30] ^= m_state[(-6*0+24+60)%30];
            m_state[((-3*(2*0+1))+60)%30] ^= m_state[((-3*(2*0+1))+4+60)%30];
            m_state[((-3*(2*0+1))+1+60)%30] ^= m_state[((-3*(2*0+1))+5+60)%30];
            m_state[((-3*(2*0+1))+2+60)%30] ^= m_state[((-3*(2*0+1))+6+60)%30];
            m_state[((-3*(2*0+1))+15+60)%30] ^= m_state[((-3*(2*0+1))+4+60)%30];
            m_state[((-3*(2*0+1))+16+60)%30] ^= m_state[((-3*(2*0+1))+5+60)%30];
            m_state[((-3*(2*0+1))+17+60)%30] ^= m_state[((-3*(2*0+1))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*0+1))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*0+1))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*0+1))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*0+1))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*0+1))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*0+1))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*0+1))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*0+1))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*0+1))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*0+1))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*0+1))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*0+1))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*0+1))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*0+1))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*0+1))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*0+1))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*0+1))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*0+1))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*0+1))+3+60)%30] = (uint)(col_13>>32);
            m_state[((-3*(2*0+1))+60)%30] = tmp_zero;
            m_state[((-3*(2*0+2))+60)%30] ^= m_state[((-3*(2*0+2))+4+60)%30];
            m_state[((-3*(2*0+2))+1+60)%30] ^= m_state[((-3*(2*0+2))+5+60)%30];
            m_state[((-3*(2*0+2))+2+60)%30] ^= m_state[((-3*(2*0+2))+6+60)%30];
            m_state[((-3*(2*0+2))+15+60)%30] ^= m_state[((-3*(2*0+2))+4+60)%30];
            m_state[((-3*(2*0+2))+16+60)%30] ^= m_state[((-3*(2*0+2))+5+60)%30];
            m_state[((-3*(2*0+2))+17+60)%30] ^= m_state[((-3*(2*0+2))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*0+2))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*0+2))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*0+2))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*0+2))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*0+2))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*0+2))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*0+2))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*0+2))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*0+2))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*0+2))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*0+2))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*0+2))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*0+2))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*0+2))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*0+2))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*0+2))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*0+2))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*0+2))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*0+2))+3+60)%30] = (uint)(col_13>>32);

            j++;

            tmp_in = *(ulong*)&((uint*)a_data)[j];
            m_state[(-6*1+1+60)%30] ^= m_state[(-6*1+24+60)%30];
            m_state[(-6*1+10+60)%30] ^= tmp_zero;
            m_state[(-6*1+8+60)%30] ^= m_state[(-6*1+60)%30] = (uint) tmp_in;
            m_state[(-6*1-3+60)%30] ^= m_state[(-6*1+1+60)%30];
            m_state[(-6*1-2+60)%30] ^= m_state[(-6*1+2+60)%30];
            m_state[(-6*1-1+60)%30] ^= m_state[(-6*1+3+60)%30];
            m_state[(-6*1+12+60)%30] ^= m_state[(-6*1+1+60)%30];
            m_state[(-6*1+13+60)%30] ^= m_state[(-6*1+2+60)%30];
            m_state[(-6*1+14+60)%30] ^= m_state[(-6*1+3+60)%30];
            tmp_in = (uint) (tmp_in >>32);
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*1+1))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*1+1))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*1+1))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*1+1))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*1+1))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*1+1))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*1+1))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*1+1))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*1+1))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*1+1))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*1+1))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*1+1))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*1+1))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*1+1))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*1+1))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*1+1))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*1+1))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*1+1))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*1+1))+3+60)%30] = (uint)(col_13>>32);
            m_state[((-3*(2*1+1))+60)%30] = tmp_zero;
            m_state[((-3*(2*1+2))+60)%30] ^= m_state[((-3*(2*1+2))+4+60)%30];
            m_state[((-3*(2*1+2))+1+60)%30] ^= m_state[((-3*(2*1+2))+5+60)%30];
            m_state[((-3*(2*1+2))+2+60)%30] ^= m_state[((-3*(2*1+2))+6+60)%30];
            m_state[((-3*(2*1+2))+15+60)%30] ^= m_state[((-3*(2*1+2))+4+60)%30];
            m_state[((-3*(2*1+2))+16+60)%30] ^= m_state[((-3*(2*1+2))+5+60)%30];
            m_state[((-3*(2*1+2))+17+60)%30] ^= m_state[((-3*(2*1+2))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*1+2))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*1+2))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*1+2))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*1+2))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*1+2))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*1+2))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*1+2))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*1+2))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*1+2))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*1+2))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*1+2))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*1+2))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*1+2))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*1+2))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*1+2))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*1+2))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*1+2))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*1+2))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*1+2))+3+60)%30] = (uint)(col_13>>32);

            j++;

            m_state[(-6*2+8+60)%30] ^= m_state[(-6*2+60)%30] = (uint)(tmp_in);
            m_state[(-6*2+10+60)%30] ^= tmp_zero;
            m_state[(-6*2+1+60)%30] ^= m_state[(-6*2+24+60)%30];
            m_state[((-3*(2*2+1))+60)%30] ^= m_state[((-3*(2*2+1))+4+60)%30];
            m_state[((-3*(2*2+1))+1+60)%30] ^= m_state[((-3*(2*2+1))+5+60)%30];
            m_state[((-3*(2*2+1))+2+60)%30] ^= m_state[((-3*(2*2+1))+6+60)%30];
            m_state[((-3*(2*2+1))+15+60)%30] ^= m_state[((-3*(2*2+1))+4+60)%30];
            m_state[((-3*(2*2+1))+16+60)%30] ^= m_state[((-3*(2*2+1))+5+60)%30];
            m_state[((-3*(2*2+1))+17+60)%30] ^= m_state[((-3*(2*2+1))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*2+1))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*2+1))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*2+1))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*2+1))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*2+1))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*2+1))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*2+1))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*2+1))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*2+1))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*2+1))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*2+1))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*2+1))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*2+1))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*2+1))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*2+1))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*2+1))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*2+1))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*2+1))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*2+1))+3+60)%30] = (uint)(col_13>>32);
            m_state[((-3*(2*2+1))+60)%30] = tmp_zero;
            m_state[((-3*(2*2+2))+60)%30] ^= m_state[((-3*(2*2+2))+4+60)%30];
            m_state[((-3*(2*2+2))+1+60)%30] ^= m_state[((-3*(2*2+2))+5+60)%30];
            m_state[((-3*(2*2+2))+2+60)%30] ^= m_state[((-3*(2*2+2))+6+60)%30];
            m_state[((-3*(2*2+2))+15+60)%30] ^= m_state[((-3*(2*2+2))+4+60)%30];
            m_state[((-3*(2*2+2))+16+60)%30] ^= m_state[((-3*(2*2+2))+5+60)%30];
            m_state[((-3*(2*2+2))+17+60)%30] ^= m_state[((-3*(2*2+2))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*2+2))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*2+2))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*2+2))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*2+2))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*2+2))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*2+2))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*2+2))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*2+2))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*2+2))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*2+2))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*2+2))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*2+2))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*2+2))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*2+2))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*2+2))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*2+2))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*2+2))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*2+2))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*2+2))+3+60)%30] = (uint)(col_13>>32);

            j++;

            tmp_in = *(ulong*)&((uint*)a_data)[j];
            m_state[(-6*3+1+60)%30] ^= m_state[(-6*3+24+60)%30];
            m_state[(-6*3+10+60)%30] ^= tmp_zero;
            m_state[(-6*3+8+60)%30] ^= m_state[(-6*3+60)%30] = (uint) tmp_in;
            m_state[(-6*3-3+60)%30] ^= m_state[(-6*3+1+60)%30];
            m_state[(-6*3-2+60)%30] ^= m_state[(-6*3+2+60)%30];
            m_state[(-6*3-1+60)%30] ^= m_state[(-6*3+3+60)%30];
            m_state[(-6*3+12+60)%30] ^= m_state[(-6*3+1+60)%30];
            m_state[(-6*3+13+60)%30] ^= m_state[(-6*3+2+60)%30];
            m_state[(-6*3+14+60)%30] ^= m_state[(-6*3+3+60)%30];
            tmp_in = (uint) (tmp_in >>32);
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*3+1))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*3+1))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*3+1))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*3+1))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*3+1))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*3+1))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*3+1))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*3+1))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*3+1))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*3+1))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*3+1))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*3+1))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*3+1))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*3+1))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*3+1))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*3+1))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*3+1))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*3+1))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*3+1))+3+60)%30] = (uint)(col_13>>32);
            m_state[((-3*(2*3+1))+60)%30] = tmp_zero;
            m_state[((-3*(2*3+2))+60)%30] ^= m_state[((-3*(2*3+2))+4+60)%30];
            m_state[((-3*(2*3+2))+1+60)%30] ^= m_state[((-3*(2*3+2))+5+60)%30];
            m_state[((-3*(2*3+2))+2+60)%30] ^= m_state[((-3*(2*3+2))+6+60)%30];
            m_state[((-3*(2*3+2))+15+60)%30] ^= m_state[((-3*(2*3+2))+4+60)%30];
            m_state[((-3*(2*3+2))+16+60)%30] ^= m_state[((-3*(2*3+2))+5+60)%30];
            m_state[((-3*(2*3+2))+17+60)%30] ^= m_state[((-3*(2*3+2))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*3+2))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*3+2))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*3+2))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*3+2))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*3+2))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*3+2))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*3+2))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*3+2))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*3+2))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*3+2))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*3+2))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*3+2))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*3+2))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*3+2))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*3+2))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*3+2))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*3+2))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*3+2))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*3+2))+3+60)%30] = (uint)(col_13>>32);

            j++;

            m_state[(-6*4+8+60)%30] ^= m_state[(-6*4+60)%30] = (uint)(tmp_in);
            m_state[(-6*4+10+60)%30] ^= tmp_zero;
            m_state[(-6*4+1+60)%30] ^= m_state[(-6*4+24+60)%30];
            m_state[((-3*(2*4+1))+60)%30] ^= m_state[((-3*(2*4+1))+4+60)%30];
            m_state[((-3*(2*4+1))+1+60)%30] ^= m_state[((-3*(2*4+1))+5+60)%30];
            m_state[((-3*(2*4+1))+2+60)%30] ^= m_state[((-3*(2*4+1))+6+60)%30];
            m_state[((-3*(2*4+1))+15+60)%30] ^= m_state[((-3*(2*4+1))+4+60)%30];
            m_state[((-3*(2*4+1))+16+60)%30] ^= m_state[((-3*(2*4+1))+5+60)%30];
            m_state[((-3*(2*4+1))+17+60)%30] ^= m_state[((-3*(2*4+1))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*4+1))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*4+1))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*4+1))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*4+1))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*4+1))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*4+1))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*4+1))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*4+1))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*4+1))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*4+1))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*4+1))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*4+1))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*4+1))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*4+1))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*4+1))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*4+1))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*4+1))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*4+1))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*4+1))+3+60)%30] = (uint)(col_13>>32);
            m_state[((-3*(2*4+1))+60)%30] = tmp_zero;
            m_state[((-3*(2*4+2))+60)%30] ^= m_state[((-3*(2*4+2))+4+60)%30];
            m_state[((-3*(2*4+2))+1+60)%30] ^= m_state[((-3*(2*4+2))+5+60)%30];
            m_state[((-3*(2*4+2))+2+60)%30] ^= m_state[((-3*(2*4+2))+6+60)%30];
            m_state[((-3*(2*4+2))+15+60)%30] ^= m_state[((-3*(2*4+2))+4+60)%30];
            m_state[((-3*(2*4+2))+16+60)%30] ^= m_state[((-3*(2*4+2))+5+60)%30];
            m_state[((-3*(2*4+2))+17+60)%30] ^= m_state[((-3*(2*4+2))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*4+2))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*4+2))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*4+2))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*4+2))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*4+2))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*4+2))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*4+2))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*4+2))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*4+2))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*4+2))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*4+2))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*4+2))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*4+2))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*4+2))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*4+2))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*4+2))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*4+2))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*4+2))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*4+2))+3+60)%30] = (uint)(col_13>>32);

            j++;
        }

        if (len_mod>=5)
        {
            tmp_in = *(ulong*)&((uint*)a_data)[j];
            m_state[(-6*0+1+60)%30] ^= m_state[(-6*0+24+60)%30];
            m_state[(-6*0+10+60)%30] ^= tmp_zero;
            m_state[(-6*0+8+60)%30] ^= m_state[(-6*0+60)%30] = (uint) tmp_in;
            m_state[(-6*0-3+60)%30] ^= m_state[(-6*0+1+60)%30];
            m_state[(-6*0-2+60)%30] ^= m_state[(-6*0+2+60)%30];
            m_state[(-6*0-1+60)%30] ^= m_state[(-6*0+3+60)%30];
            m_state[(-6*0+12+60)%30] ^= m_state[(-6*0+1+60)%30];
            m_state[(-6*0+13+60)%30] ^= m_state[(-6*0+2+60)%30];
            m_state[(-6*0+14+60)%30] ^= m_state[(-6*0+3+60)%30];
            tmp_in = (uint) (tmp_in >>32);
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*0+1))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*0+1))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*0+1))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*0+1))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*0+1))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*0+1))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*0+1))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*0+1))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*0+1))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*0+1))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*0+1))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*0+1))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*0+1))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*0+1))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*0+1))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*0+1))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*0+1))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*0+1))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*0+1))+3+60)%30] = (uint)(col_13>>32);
            m_state[((-3*(2*0+1))+60)%30] = tmp_zero;
            m_state[((-3*(2*0+2))+60)%30] ^= m_state[((-3*(2*0+2))+4+60)%30];
            m_state[((-3*(2*0+2))+1+60)%30] ^= m_state[((-3*(2*0+2))+5+60)%30];
            m_state[((-3*(2*0+2))+2+60)%30] ^= m_state[((-3*(2*0+2))+6+60)%30];
            m_state[((-3*(2*0+2))+15+60)%30] ^= m_state[((-3*(2*0+2))+4+60)%30];
            m_state[((-3*(2*0+2))+16+60)%30] ^= m_state[((-3*(2*0+2))+5+60)%30];
            m_state[((-3*(2*0+2))+17+60)%30] ^= m_state[((-3*(2*0+2))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*0+2))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*0+2))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*0+2))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*0+2))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*0+2))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*0+2))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*0+2))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*0+2))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*0+2))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*0+2))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*0+2))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*0+2))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*0+2))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*0+2))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*0+2))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*0+2))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*0+2))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*0+2))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*0+2))+3+60)%30] = (uint)(col_13>>32);

            j++;

            m_state[(-6*1+8+60)%30] ^= m_state[(-6*1+60)%30] = (uint)(tmp_in);
            m_state[(-6*1+10+60)%30] ^= tmp_zero;
            m_state[(-6*1+1+60)%30] ^= m_state[(-6*1+24+60)%30];
            m_state[((-3*(2*1+1))+60)%30] ^= m_state[((-3*(2*1+1))+4+60)%30];
            m_state[((-3*(2*1+1))+1+60)%30] ^= m_state[((-3*(2*1+1))+5+60)%30];
            m_state[((-3*(2*1+1))+2+60)%30] ^= m_state[((-3*(2*1+1))+6+60)%30];
            m_state[((-3*(2*1+1))+15+60)%30] ^= m_state[((-3*(2*1+1))+4+60)%30];
            m_state[((-3*(2*1+1))+16+60)%30] ^= m_state[((-3*(2*1+1))+5+60)%30];
            m_state[((-3*(2*1+1))+17+60)%30] ^= m_state[((-3*(2*1+1))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*1+1))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*1+1))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*1+1))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*1+1))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*1+1))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*1+1))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*1+1))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*1+1))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*1+1))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*1+1))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*1+1))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*1+1))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*1+1))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*1+1))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*1+1))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*1+1))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*1+1))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*1+1))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*1+1))+3+60)%30] = (uint)(col_13>>32);
            m_state[((-3*(2*1+1))+60)%30] = tmp_zero;
            m_state[((-3*(2*1+2))+60)%30] ^= m_state[((-3*(2*1+2))+4+60)%30];
            m_state[((-3*(2*1+2))+1+60)%30] ^= m_state[((-3*(2*1+2))+5+60)%30];
            m_state[((-3*(2*1+2))+2+60)%30] ^= m_state[((-3*(2*1+2))+6+60)%30];
            m_state[((-3*(2*1+2))+15+60)%30] ^= m_state[((-3*(2*1+2))+4+60)%30];
            m_state[((-3*(2*1+2))+16+60)%30] ^= m_state[((-3*(2*1+2))+5+60)%30];
            m_state[((-3*(2*1+2))+17+60)%30] ^= m_state[((-3*(2*1+2))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*1+2))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*1+2))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*1+2))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*1+2))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*1+2))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*1+2))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*1+2))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*1+2))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*1+2))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*1+2))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*1+2))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*1+2))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*1+2))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*1+2))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*1+2))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*1+2))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*1+2))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*1+2))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*1+2))+3+60)%30] = (uint)(col_13>>32);

            j++;

            tmp_in = *(ulong*)&((uint*)a_data)[j];
            m_state[(-6*2+1+60)%30] ^= m_state[(-6*2+24+60)%30];
            m_state[(-6*2+10+60)%30] ^= tmp_zero;
            m_state[(-6*2+8+60)%30] ^= m_state[(-6*2+60)%30] = (uint) tmp_in;
            m_state[(-6*2-3+60)%30] ^= m_state[(-6*2+1+60)%30];
            m_state[(-6*2-2+60)%30] ^= m_state[(-6*2+2+60)%30];
            m_state[(-6*2-1+60)%30] ^= m_state[(-6*2+3+60)%30];
            m_state[(-6*2+12+60)%30] ^= m_state[(-6*2+1+60)%30];
            m_state[(-6*2+13+60)%30] ^= m_state[(-6*2+2+60)%30];
            m_state[(-6*2+14+60)%30] ^= m_state[(-6*2+3+60)%30];
            tmp_in = (uint) (tmp_in >>32);
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*2+1))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*2+1))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*2+1))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*2+1))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*2+1))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*2+1))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*2+1))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*2+1))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*2+1))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*2+1))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*2+1))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*2+1))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*2+1))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*2+1))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*2+1))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*2+1))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*2+1))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*2+1))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*2+1))+3+60)%30] = (uint)(col_13>>32);
            m_state[((-3*(2*2+1))+60)%30] = tmp_zero;
            m_state[((-3*(2*2+2))+60)%30] ^= m_state[((-3*(2*2+2))+4+60)%30];
            m_state[((-3*(2*2+2))+1+60)%30] ^= m_state[((-3*(2*2+2))+5+60)%30];
            m_state[((-3*(2*2+2))+2+60)%30] ^= m_state[((-3*(2*2+2))+6+60)%30];
            m_state[((-3*(2*2+2))+15+60)%30] ^= m_state[((-3*(2*2+2))+4+60)%30];
            m_state[((-3*(2*2+2))+16+60)%30] ^= m_state[((-3*(2*2+2))+5+60)%30];
            m_state[((-3*(2*2+2))+17+60)%30] ^= m_state[((-3*(2*2+2))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*2+2))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*2+2))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*2+2))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*2+2))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*2+2))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*2+2))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*2+2))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*2+2))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*2+2))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*2+2))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*2+2))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*2+2))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*2+2))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*2+2))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*2+2))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*2+2))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*2+2))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*2+2))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*2+2))+3+60)%30] = (uint)(col_13>>32);

            j++;

            m_state[(-6*3+8+60)%30] ^= m_state[(-6*3+60)%30] = (uint)(tmp_in);
            m_state[(-6*3+10+60)%30] ^= tmp_zero;
            m_state[(-6*3+1+60)%30] ^= m_state[(-6*3+24+60)%30];
            m_state[((-3*(2*3+1))+60)%30] ^= m_state[((-3*(2*3+1))+4+60)%30];
            m_state[((-3*(2*3+1))+1+60)%30] ^= m_state[((-3*(2*3+1))+5+60)%30];
            m_state[((-3*(2*3+1))+2+60)%30] ^= m_state[((-3*(2*3+1))+6+60)%30];
            m_state[((-3*(2*3+1))+15+60)%30] ^= m_state[((-3*(2*3+1))+4+60)%30];
            m_state[((-3*(2*3+1))+16+60)%30] ^= m_state[((-3*(2*3+1))+5+60)%30];
            m_state[((-3*(2*3+1))+17+60)%30] ^= m_state[((-3*(2*3+1))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*3+1))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*3+1))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*3+1))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*3+1))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*3+1))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*3+1))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*3+1))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*3+1))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*3+1))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*3+1))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*3+1))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*3+1))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*3+1))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*3+1))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*3+1))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*3+1))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*3+1))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*3+1))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*3+1))+3+60)%30] = (uint)(col_13>>32);
            m_state[((-3*(2*3+1))+60)%30] = tmp_zero;
            m_state[((-3*(2*3+2))+60)%30] ^= m_state[((-3*(2*3+2))+4+60)%30];
            m_state[((-3*(2*3+2))+1+60)%30] ^= m_state[((-3*(2*3+2))+5+60)%30];
            m_state[((-3*(2*3+2))+2+60)%30] ^= m_state[((-3*(2*3+2))+6+60)%30];
            m_state[((-3*(2*3+2))+15+60)%30] ^= m_state[((-3*(2*3+2))+4+60)%30];
            m_state[((-3*(2*3+2))+16+60)%30] ^= m_state[((-3*(2*3+2))+5+60)%30];
            m_state[((-3*(2*3+2))+17+60)%30] ^= m_state[((-3*(2*3+2))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*3+2))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*3+2))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*3+2))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*3+2))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*3+2))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*3+2))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*3+2))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*3+2))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*3+2))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*3+2))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*3+2))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*3+2))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*3+2))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*3+2))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*3+2))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*3+2))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*3+2))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*3+2))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*3+2))+3+60)%30] = (uint)(col_13>>32);

            j++;

            m_state[((-6*4)+10+60)%30] ^= tmp_zero;
            m_state[((-6*4)+60)%30] = ((uint*)a_data)[j];
            m_state[((-6*4)+8+60)%30] ^= m_state[((-6*4)+60)%30];
            m_state[((-6*4)+1+60)%30] ^= m_state[((-6*4)+24+60)%30];
            m_state[((-3*(2*4+1))+60)%30] ^= m_state[((-3*(2*4+1))+4+60)%30];
            m_state[((-3*(2*4+1))+1+60)%30] ^= m_state[((-3*(2*4+1))+5+60)%30];
            m_state[((-3*(2*4+1))+2+60)%30] ^= m_state[((-3*(2*4+1))+6+60)%30];
            m_state[((-3*(2*4+1))+15+60)%30] ^= m_state[((-3*(2*4+1))+4+60)%30];
            m_state[((-3*(2*4+1))+16+60)%30] ^= m_state[((-3*(2*4+1))+5+60)%30];
            m_state[((-3*(2*4+1))+17+60)%30] ^= m_state[((-3*(2*4+1))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*4+1))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*4+1))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*4+1))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*4+1))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*4+1))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*4+1))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*4+1))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*4+1))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*4+1))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*4+1))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*4+1))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*4+1))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*4+1))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*4+1))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*4+1))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*4+1))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*4+1))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*4+1))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*4+1))+3+60)%30] = (uint)(col_13>>32);
            m_state[((-3*(2*4+1))+60)%30] = tmp_zero;
            m_state[((-3*(2*4+2))+60)%30] ^= m_state[((-3*(2*4+2))+4+60)%30];
            m_state[((-3*(2*4+2))+1+60)%30] ^= m_state[((-3*(2*4+2))+5+60)%30];
            m_state[((-3*(2*4+2))+2+60)%30] ^= m_state[((-3*(2*4+2))+6+60)%30];
            m_state[((-3*(2*4+2))+15+60)%30] ^= m_state[((-3*(2*4+2))+4+60)%30];
            m_state[((-3*(2*4+2))+16+60)%30] ^= m_state[((-3*(2*4+2))+5+60)%30];
            m_state[((-3*(2*4+2))+17+60)%30] ^= m_state[((-3*(2*4+2))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*4+2))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*4+2))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*4+2))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*4+2))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*4+2))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*4+2))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*4+2))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*4+2))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*4+2))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*4+2))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*4+2))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*4+2))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*4+2))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*4+2))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*4+2))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*4+2))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*4+2))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*4+2))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*4+2))+3+60)%30] = (uint)(col_13>>32);

            j++;

            len_mod = len_mod -5;
        }

        if (len_mod >=1)
        {
            m_state[((-6*0)+10+60)%30] ^= tmp_zero;
            m_state[((-6*0)+60)%30] = ((uint*)a_data)[j];
            m_state[((-6*0)+8+60)%30] ^= m_state[((-6*0)+60)%30];
            m_state[((-6*0)+1+60)%30] ^= m_state[((-6*0)+24+60)%30];
            m_state[((-3*(2*0+1))+60)%30] ^= m_state[((-3*(2*0+1))+4+60)%30];
            m_state[((-3*(2*0+1))+1+60)%30] ^= m_state[((-3*(2*0+1))+5+60)%30];
            m_state[((-3*(2*0+1))+2+60)%30] ^= m_state[((-3*(2*0+1))+6+60)%30];
            m_state[((-3*(2*0+1))+15+60)%30] ^= m_state[((-3*(2*0+1))+4+60)%30];
            m_state[((-3*(2*0+1))+16+60)%30] ^= m_state[((-3*(2*0+1))+5+60)%30];
            m_state[((-3*(2*0+1))+17+60)%30] ^= m_state[((-3*(2*0+1))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*0+1))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*0+1))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*0+1))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*0+1))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*0+1))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*0+1))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*0+1))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*0+1))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*0+1))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*0+1))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*0+1))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*0+1))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*0+1))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*0+1))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*0+1))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*0+1))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*0+1))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*0+1))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*0+1))+3+60)%30] = (uint)(col_13>>32);
            m_state[((-3*(2*0+1))+60)%30] = tmp_zero;
            m_state[((-3*(2*0+2))+60)%30] ^= m_state[((-3*(2*0+2))+4+60)%30];
            m_state[((-3*(2*0+2))+1+60)%30] ^= m_state[((-3*(2*0+2))+5+60)%30];
            m_state[((-3*(2*0+2))+2+60)%30] ^= m_state[((-3*(2*0+2))+6+60)%30];
            m_state[((-3*(2*0+2))+15+60)%30] ^= m_state[((-3*(2*0+2))+4+60)%30];
            m_state[((-3*(2*0+2))+16+60)%30] ^= m_state[((-3*(2*0+2))+5+60)%30];
            m_state[((-3*(2*0+2))+17+60)%30] ^= m_state[((-3*(2*0+2))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*0+2))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*0+2))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*0+2))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*0+2))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*0+2))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*0+2))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*0+2))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*0+2))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*0+2))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*0+2))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*0+2))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*0+2))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*0+2))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*0+2))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*0+2))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*0+2))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*0+2))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*0+2))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*0+2))+3+60)%30] = (uint)(col_13>>32);

            j++;

            if (len_mod >=2)
            {
                m_state[((-6*1)+10+60)%30] ^= tmp_zero;
                m_state[((-6*1)+60)%30] = ((uint*)a_data)[j];
                m_state[((-6*1)+8+60)%30] ^= m_state[((-6*1)+60)%30];
                m_state[((-6*1)+1+60)%30] ^= m_state[((-6*1)+24+60)%30];
                m_state[((-3*(2*1+1))+60)%30] ^= m_state[((-3*(2*1+1))+4+60)%30];
                m_state[((-3*(2*1+1))+1+60)%30] ^= m_state[((-3*(2*1+1))+5+60)%30];
                m_state[((-3*(2*1+1))+2+60)%30] ^= m_state[((-3*(2*1+1))+6+60)%30];
                m_state[((-3*(2*1+1))+15+60)%30] ^= m_state[((-3*(2*1+1))+4+60)%30];
                m_state[((-3*(2*1+1))+16+60)%30] ^= m_state[((-3*(2*1+1))+5+60)%30];
                m_state[((-3*(2*1+1))+17+60)%30] ^= m_state[((-3*(2*1+1))+6+60)%30];
                row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*1+1))+3+60)%30])];
                col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*1+1))+3+60)%30]>>8)];
                col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*1+1))+3+60)%30]>>16)];
                col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*1+1))+3+60)%30]>>24)];
                col0 = aes_style_table0[(byte)(m_state[((-3*(2*1+1))+60)%30])];
                tmp = aes_style_table1[(byte)(m_state[((-3*(2*1+1))+60)%30]>>8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = aes_style_table2[(byte)(m_state[((-3*(2*1+1))+60)%30]>>16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*1+1))+60)%30]>>24)];
                row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*1+1))+1+60)%30])];
                col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*1+1))+1+60)%30]>>8)];
                tmp = aes_style_table2[(byte)(m_state[((-3*(2*1+1))+1+60)%30]>>16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = aes_style_table3[(byte)(m_state[((-3*(2*1+1))+1+60)%30]>>24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*1+1))+2+60)%30])];
                tmp = aes_style_table1[(byte)(m_state[((-3*(2*1+1))+2+60)%30]>>8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*1+1))+2+60)%30]>>16)];
                tmp = aes_style_table3[(byte)(m_state[((-3*(2*1+1))+2+60)%30]>>24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0^((ulong)col2<<32);
                col_1 = (uint)col1^((ulong)col3<<32);
                col_2 = (uint)col2^((ulong)col0<<32);
                col_3 = (uint)col3^((ulong)col1<<32);
                col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
                row0=row0>>8;
                row1=row1>>8;
                row2=row2>>8;
                row3=row3<<24;
                col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
                tmp_zero = (uint) col_02;
                m_state[((-3*(2*1+1))+2+60)%30] = (uint)(col_02>>32);
                m_state[((-3*(2*1+1))+1+60)%30] = (uint)col_13;
                m_state[((-3*(2*1+1))+3+60)%30] = (uint)(col_13>>32);
                m_state[((-3*(2*1+1))+60)%30] = tmp_zero;
                m_state[((-3*(2*1+2))+60)%30] ^= m_state[((-3*(2*1+2))+4+60)%30];
                m_state[((-3*(2*1+2))+1+60)%30] ^= m_state[((-3*(2*1+2))+5+60)%30];
                m_state[((-3*(2*1+2))+2+60)%30] ^= m_state[((-3*(2*1+2))+6+60)%30];
                m_state[((-3*(2*1+2))+15+60)%30] ^= m_state[((-3*(2*1+2))+4+60)%30];
                m_state[((-3*(2*1+2))+16+60)%30] ^= m_state[((-3*(2*1+2))+5+60)%30];
                m_state[((-3*(2*1+2))+17+60)%30] ^= m_state[((-3*(2*1+2))+6+60)%30];
                row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*1+2))+3+60)%30])];
                col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*1+2))+3+60)%30]>>8)];
                col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*1+2))+3+60)%30]>>16)];
                col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*1+2))+3+60)%30]>>24)];
                col0 = aes_style_table0[(byte)(m_state[((-3*(2*1+2))+60)%30])];
                tmp = aes_style_table1[(byte)(m_state[((-3*(2*1+2))+60)%30]>>8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = aes_style_table2[(byte)(m_state[((-3*(2*1+2))+60)%30]>>16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*1+2))+60)%30]>>24)];
                row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*1+2))+1+60)%30])];
                col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*1+2))+1+60)%30]>>8)];
                tmp = aes_style_table2[(byte)(m_state[((-3*(2*1+2))+1+60)%30]>>16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = aes_style_table3[(byte)(m_state[((-3*(2*1+2))+1+60)%30]>>24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*1+2))+2+60)%30])];
                tmp = aes_style_table1[(byte)(m_state[((-3*(2*1+2))+2+60)%30]>>8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*1+2))+2+60)%30]>>16)];
                tmp = aes_style_table3[(byte)(m_state[((-3*(2*1+2))+2+60)%30]>>24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0^((ulong)col2<<32);
                col_1 = (uint)col1^((ulong)col3<<32);
                col_2 = (uint)col2^((ulong)col0<<32);
                col_3 = (uint)col3^((ulong)col1<<32);
                col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
                row0=row0>>8;
                row1=row1>>8;
                row2=row2>>8;
                row3=row3<<24;
                col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
                tmp_zero = (uint) col_02;
                m_state[((-3*(2*1+2))+2+60)%30] = (uint)(col_02>>32);
                m_state[((-3*(2*1+2))+1+60)%30] = (uint)col_13;
                m_state[((-3*(2*1+2))+3+60)%30] = (uint)(col_13>>32);

                j++;

                if (len_mod >=3)
                {
                    m_state[((-6*2)+10+60)%30] ^= tmp_zero;
                    m_state[((-6*2)+60)%30] = ((uint*)a_data)[j];
                    m_state[((-6*2)+8+60)%30] ^= m_state[((-6*2)+60)%30];
                    m_state[((-6*2)+1+60)%30] ^= m_state[((-6*2)+24+60)%30];
                    m_state[((-3*(2*2+1))+60)%30] ^= m_state[((-3*(2*2+1))+4+60)%30];
                    m_state[((-3*(2*2+1))+1+60)%30] ^= m_state[((-3*(2*2+1))+5+60)%30];
                    m_state[((-3*(2*2+1))+2+60)%30] ^= m_state[((-3*(2*2+1))+6+60)%30];
                    m_state[((-3*(2*2+1))+15+60)%30] ^= m_state[((-3*(2*2+1))+4+60)%30];
                    m_state[((-3*(2*2+1))+16+60)%30] ^= m_state[((-3*(2*2+1))+5+60)%30];
                    m_state[((-3*(2*2+1))+17+60)%30] ^= m_state[((-3*(2*2+1))+6+60)%30];
                    row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*2+1))+3+60)%30])];
                    col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*2+1))+3+60)%30]>>8)];
                    col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*2+1))+3+60)%30]>>16)];
                    col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*2+1))+3+60)%30]>>24)];
                    col0 = aes_style_table0[(byte)(m_state[((-3*(2*2+1))+60)%30])];
                    tmp = aes_style_table1[(byte)(m_state[((-3*(2*2+1))+60)%30]>>8)];
                    row1 ^= tmp;
                    col0 ^= tmp;
                    tmp = aes_style_table2[(byte)(m_state[((-3*(2*2+1))+60)%30]>>16)];
                    row2 ^= tmp;
                    col0 ^= tmp;
                    col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*2+1))+60)%30]>>24)];
                    row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*2+1))+1+60)%30])];
                    col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*2+1))+1+60)%30]>>8)];
                    tmp = aes_style_table2[(byte)(m_state[((-3*(2*2+1))+1+60)%30]>>16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = aes_style_table3[(byte)(m_state[((-3*(2*2+1))+1+60)%30]>>24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*2+1))+2+60)%30])];
                    tmp = aes_style_table1[(byte)(m_state[((-3*(2*2+1))+2+60)%30]>>8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*2+1))+2+60)%30]>>16)];
                    tmp = aes_style_table3[(byte)(m_state[((-3*(2*2+1))+2+60)%30]>>24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    col_0 = (uint)col0^((ulong)col2<<32);
                    col_1 = (uint)col1^((ulong)col3<<32);
                    col_2 = (uint)col2^((ulong)col0<<32);
                    col_3 = (uint)col3^((ulong)col1<<32);
                    col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
                    row0=row0>>8;
                    row1=row1>>8;
                    row2=row2>>8;
                    row3=row3<<24;
                    col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
                    tmp_zero = (uint) col_02;
                    m_state[((-3*(2*2+1))+2+60)%30] = (uint)(col_02>>32);
                    m_state[((-3*(2*2+1))+1+60)%30] = (uint)col_13;
                    m_state[((-3*(2*2+1))+3+60)%30] = (uint)(col_13>>32);
                    m_state[((-3*(2*2+1))+60)%30] = tmp_zero;
                    m_state[((-3*(2*2+2))+60)%30] ^= m_state[((-3*(2*2+2))+4+60)%30];
                    m_state[((-3*(2*2+2))+1+60)%30] ^= m_state[((-3*(2*2+2))+5+60)%30];
                    m_state[((-3*(2*2+2))+2+60)%30] ^= m_state[((-3*(2*2+2))+6+60)%30];
                    m_state[((-3*(2*2+2))+15+60)%30] ^= m_state[((-3*(2*2+2))+4+60)%30];
                    m_state[((-3*(2*2+2))+16+60)%30] ^= m_state[((-3*(2*2+2))+5+60)%30];
                    m_state[((-3*(2*2+2))+17+60)%30] ^= m_state[((-3*(2*2+2))+6+60)%30];
                    row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*2+2))+3+60)%30])];
                    col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*2+2))+3+60)%30]>>8)];
                    col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*2+2))+3+60)%30]>>16)];
                    col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*2+2))+3+60)%30]>>24)];
                    col0 = aes_style_table0[(byte)(m_state[((-3*(2*2+2))+60)%30])];
                    tmp = aes_style_table1[(byte)(m_state[((-3*(2*2+2))+60)%30]>>8)];
                    row1 ^= tmp;
                    col0 ^= tmp;
                    tmp = aes_style_table2[(byte)(m_state[((-3*(2*2+2))+60)%30]>>16)];
                    row2 ^= tmp;
                    col0 ^= tmp;
                    col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*2+2))+60)%30]>>24)];
                    row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*2+2))+1+60)%30])];
                    col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*2+2))+1+60)%30]>>8)];
                    tmp = aes_style_table2[(byte)(m_state[((-3*(2*2+2))+1+60)%30]>>16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = aes_style_table3[(byte)(m_state[((-3*(2*2+2))+1+60)%30]>>24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*2+2))+2+60)%30])];
                    tmp = aes_style_table1[(byte)(m_state[((-3*(2*2+2))+2+60)%30]>>8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*2+2))+2+60)%30]>>16)];
                    tmp = aes_style_table3[(byte)(m_state[((-3*(2*2+2))+2+60)%30]>>24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    col_0 = (uint)col0^((ulong)col2<<32);
                    col_1 = (uint)col1^((ulong)col3<<32);
                    col_2 = (uint)col2^((ulong)col0<<32);
                    col_3 = (uint)col3^((ulong)col1<<32);
                    col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
                    row0=row0>>8;
                    row1=row1>>8;
                    row2=row2>>8;
                    row3=row3<<24;
                    col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
                    tmp_zero = (uint) col_02;
                    m_state[((-3*(2*2+2))+2+60)%30] = (uint)(col_02>>32);
                    m_state[((-3*(2*2+2))+1+60)%30] = (uint)col_13;
                    m_state[((-3*(2*2+2))+3+60)%30] = (uint)(col_13>>32);

                    j++;

                    if (len_mod >=4)
                    {
                        m_state[((-6*3)+10+60)%30] ^= tmp_zero;
                        m_state[((-6*3)+60)%30] = ((uint*)a_data)[j];
                        m_state[((-6*3)+8+60)%30] ^= m_state[((-6*3)+60)%30];
                        m_state[((-6*3)+1+60)%30] ^= m_state[((-6*3)+24+60)%30];
                        m_state[((-3*(2*3+1))+60)%30] ^= m_state[((-3*(2*3+1))+4+60)%30];
                        m_state[((-3*(2*3+1))+1+60)%30] ^= m_state[((-3*(2*3+1))+5+60)%30];
                        m_state[((-3*(2*3+1))+2+60)%30] ^= m_state[((-3*(2*3+1))+6+60)%30];
                        m_state[((-3*(2*3+1))+15+60)%30] ^= m_state[((-3*(2*3+1))+4+60)%30];
                        m_state[((-3*(2*3+1))+16+60)%30] ^= m_state[((-3*(2*3+1))+5+60)%30];
                        m_state[((-3*(2*3+1))+17+60)%30] ^= m_state[((-3*(2*3+1))+6+60)%30];
                        row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*3+1))+3+60)%30])];
                        col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*3+1))+3+60)%30]>>8)];
                        col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*3+1))+3+60)%30]>>16)];
                        col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*3+1))+3+60)%30]>>24)];
                        col0 = aes_style_table0[(byte)(m_state[((-3*(2*3+1))+60)%30])];
                        tmp = aes_style_table1[(byte)(m_state[((-3*(2*3+1))+60)%30]>>8)];
                        row1 ^= tmp;
                        col0 ^= tmp;
                        tmp = aes_style_table2[(byte)(m_state[((-3*(2*3+1))+60)%30]>>16)];
                        row2 ^= tmp;
                        col0 ^= tmp;
                        col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*3+1))+60)%30]>>24)];
                        row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*3+1))+1+60)%30])];
                        col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*3+1))+1+60)%30]>>8)];
                        tmp = aes_style_table2[(byte)(m_state[((-3*(2*3+1))+1+60)%30]>>16)];
                        row2 ^= tmp;
                        col1 ^= tmp;
                        tmp = aes_style_table3[(byte)(m_state[((-3*(2*3+1))+1+60)%30]>>24)];
                        row3 ^= tmp;
                        col1 ^= tmp;
                        row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*3+1))+2+60)%30])];
                        tmp = aes_style_table1[(byte)(m_state[((-3*(2*3+1))+2+60)%30]>>8)];
                        row1 ^= tmp;
                        col2 ^= tmp;
                        col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*3+1))+2+60)%30]>>16)];
                        tmp = aes_style_table3[(byte)(m_state[((-3*(2*3+1))+2+60)%30]>>24)];
                        row3 ^= tmp;
                        col2 ^= tmp;
                        col_0 = (uint)col0^((ulong)col2<<32);
                        col_1 = (uint)col1^((ulong)col3<<32);
                        col_2 = (uint)col2^((ulong)col0<<32);
                        col_3 = (uint)col3^((ulong)col1<<32);
                        col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
                        row0=row0>>8;
                        row1=row1>>8;
                        row2=row2>>8;
                        row3=row3<<24;
                        col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
                        tmp_zero = (uint) col_02;
                        m_state[((-3*(2*3+1))+2+60)%30] = (uint)(col_02>>32);
                        m_state[((-3*(2*3+1))+1+60)%30] = (uint)col_13;
                        m_state[((-3*(2*3+1))+3+60)%30] = (uint)(col_13>>32);
                        m_state[((-3*(2*3+1))+60)%30] = tmp_zero;
                        m_state[((-3*(2*3+2))+60)%30] ^= m_state[((-3*(2*3+2))+4+60)%30];
                        m_state[((-3*(2*3+2))+1+60)%30] ^= m_state[((-3*(2*3+2))+5+60)%30];
                        m_state[((-3*(2*3+2))+2+60)%30] ^= m_state[((-3*(2*3+2))+6+60)%30];
                        m_state[((-3*(2*3+2))+15+60)%30] ^= m_state[((-3*(2*3+2))+4+60)%30];
                        m_state[((-3*(2*3+2))+16+60)%30] ^= m_state[((-3*(2*3+2))+5+60)%30];
                        m_state[((-3*(2*3+2))+17+60)%30] ^= m_state[((-3*(2*3+2))+6+60)%30];
                        row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*3+2))+3+60)%30])];
                        col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*3+2))+3+60)%30]>>8)];
                        col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*3+2))+3+60)%30]>>16)];
                        col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*3+2))+3+60)%30]>>24)];
                        col0 = aes_style_table0[(byte)(m_state[((-3*(2*3+2))+60)%30])];
                        tmp = aes_style_table1[(byte)(m_state[((-3*(2*3+2))+60)%30]>>8)];
                        row1 ^= tmp;
                        col0 ^= tmp;
                        tmp = aes_style_table2[(byte)(m_state[((-3*(2*3+2))+60)%30]>>16)];
                        row2 ^= tmp;
                        col0 ^= tmp;
                        col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*3+2))+60)%30]>>24)];
                        row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*3+2))+1+60)%30])];
                        col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*3+2))+1+60)%30]>>8)];
                        tmp = aes_style_table2[(byte)(m_state[((-3*(2*3+2))+1+60)%30]>>16)];
                        row2 ^= tmp;
                        col1 ^= tmp;
                        tmp = aes_style_table3[(byte)(m_state[((-3*(2*3+2))+1+60)%30]>>24)];
                        row3 ^= tmp;
                        col1 ^= tmp;
                        row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*3+2))+2+60)%30])];
                        tmp = aes_style_table1[(byte)(m_state[((-3*(2*3+2))+2+60)%30]>>8)];
                        row1 ^= tmp;
                        col2 ^= tmp;
                        col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*3+2))+2+60)%30]>>16)];
                        tmp = aes_style_table3[(byte)(m_state[((-3*(2*3+2))+2+60)%30]>>24)];
                        row3 ^= tmp;
                        col2 ^= tmp;
                        col_0 = (uint)col0^((ulong)col2<<32);
                        col_1 = (uint)col1^((ulong)col3<<32);
                        col_2 = (uint)col2^((ulong)col0<<32);
                        col_3 = (uint)col3^((ulong)col1<<32);
                        col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
                        row0=row0>>8;
                        row1=row1>>8;
                        row2=row2>>8;
                        row3=row3<<24;
                        col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
                        tmp_zero = (uint) col_02;
                        m_state[((-3*(2*3+2))+2+60)%30] = (uint)(col_02>>32);
                        m_state[((-3*(2*3+2))+1+60)%30] = (uint)col_13;
                        m_state[((-3*(2*3+2))+3+60)%30] = (uint)(col_13>>32);

                        j++;
                    }
                }
            }
        }

        m_state[(ptr-6*len_mod+60)%30] = tmp_zero;

        m_base = (ptr-6*len_mod+2*30)%30;
    }

    byte* Fugue256Base::GetResult()
    {
        ulong row0, row1, row2, row3;
        ulong col0, col1, col2, col3;
        ulong tmp;
        uint tmp_zero;
        ulong col_0,col_1,col_2,col_3,col_02,col_13;
        uint j1 = (5-m_base/6)%5;
        int ptr = m_base;

        for (int j=0; j<5; j++) 
        {
            m_state[((-3*(2*((j1+j)%5)+1))+60)%30] ^= m_state[((-3*(2*((j1+j)%5)+1))+4+60)%30];
            m_state[((-3*(2*((j1+j)%5)+1))+1+60)%30] ^= m_state[((-3*(2*((j1+j)%5)+1))+5+60)%30];
            m_state[((-3*(2*((j1+j)%5)+1))+2+60)%30] ^= m_state[((-3*(2*((j1+j)%5)+1))+6+60)%30];
            m_state[((-3*(2*((j1+j)%5)+1))+15+60)%30] ^= m_state[((-3*(2*((j1+j)%5)+1))+4+60)%30];
            m_state[((-3*(2*((j1+j)%5)+1))+16+60)%30] ^= m_state[((-3*(2*((j1+j)%5)+1))+5+60)%30];
            m_state[((-3*(2*((j1+j)%5)+1))+17+60)%30] ^= m_state[((-3*(2*((j1+j)%5)+1))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*((j1+j)%5)+1))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*((j1+j)%5)+1))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*((j1+j)%5)+1))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*((j1+j)%5)+1))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*((j1+j)%5)+1))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*((j1+j)%5)+1))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*((j1+j)%5)+1))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*((j1+j)%5)+1))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*((j1+j)%5)+1))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*((j1+j)%5)+1))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*((j1+j)%5)+1))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*((j1+j)%5)+1))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*((j1+j)%5)+1))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*((j1+j)%5)+1))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*((j1+j)%5)+1))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*((j1+j)%5)+1))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*((j1+j)%5)+1))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*((j1+j)%5)+1))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*((j1+j)%5)+1))+3+60)%30] = (uint)(col_13>>32);
            m_state[((-3*(2*((j1+j)%5)+1))+60)%30] = tmp_zero;
            m_state[((-3*(2*((j1+j)%5)+2))+60)%30] ^= m_state[((-3*(2*((j1+j)%5)+2))+4+60)%30];
            m_state[((-3*(2*((j1+j)%5)+2))+1+60)%30] ^= m_state[((-3*(2*((j1+j)%5)+2))+5+60)%30];
            m_state[((-3*(2*((j1+j)%5)+2))+2+60)%30] ^= m_state[((-3*(2*((j1+j)%5)+2))+6+60)%30];
            m_state[((-3*(2*((j1+j)%5)+2))+15+60)%30] ^= m_state[((-3*(2*((j1+j)%5)+2))+4+60)%30];
            m_state[((-3*(2*((j1+j)%5)+2))+16+60)%30] ^= m_state[((-3*(2*((j1+j)%5)+2))+5+60)%30];
            m_state[((-3*(2*((j1+j)%5)+2))+17+60)%30] ^= m_state[((-3*(2*((j1+j)%5)+2))+6+60)%30];
            row0 = col3 = aes_style_table0[(byte)(m_state[((-3*(2*((j1+j)%5)+2))+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[((-3*(2*((j1+j)%5)+2))+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[((-3*(2*((j1+j)%5)+2))+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[((-3*(2*((j1+j)%5)+2))+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[((-3*(2*((j1+j)%5)+2))+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*((j1+j)%5)+2))+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*((j1+j)%5)+2))+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[((-3*(2*((j1+j)%5)+2))+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[((-3*(2*((j1+j)%5)+2))+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[((-3*(2*((j1+j)%5)+2))+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[((-3*(2*((j1+j)%5)+2))+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*((j1+j)%5)+2))+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[((-3*(2*((j1+j)%5)+2))+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[((-3*(2*((j1+j)%5)+2))+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[((-3*(2*((j1+j)%5)+2))+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[((-3*(2*((j1+j)%5)+2))+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[((-3*(2*((j1+j)%5)+2))+2+60)%30] = (uint)(col_02>>32);
            m_state[((-3*(2*((j1+j)%5)+2))+1+60)%30] = (uint)col_13;
            m_state[((-3*(2*((j1+j)%5)+2))+3+60)%30] = (uint)(col_13>>32);
            m_state[((-3*(2*((j1+j)%5)+2))+60)%30] = tmp_zero;
        }

        for (int j=0; j<13; j++) 
        { 
            m_state[(ptr+4+60)%30] ^=m_state[(ptr+60)%30];
            m_state[(ptr+15+60)%30] ^=m_state[(ptr+60)%30];
            ptr = ((ptr-15+30)%30);
            row0 = col3 = aes_style_table0[(byte)(m_state[(ptr+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[(ptr+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[(ptr+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[(ptr+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[(ptr+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[(ptr+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[(ptr+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[(ptr+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[(ptr+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[(ptr+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[(ptr+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[(ptr+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[(ptr+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[(ptr+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[(ptr+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[(ptr+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[(ptr+2+60)%30] = (uint)(col_02>>32);
            m_state[(ptr+1+60)%30] = (uint)col_13;
            m_state[(ptr+3+60)%30] = (uint)(col_13>>32);
            m_state[(ptr+60)%30] = tmp_zero;
            m_state[(ptr+4+60)%30] ^=m_state[(ptr+60)%30];
            m_state[(ptr+16+60)%30] ^=m_state[(ptr+60)%30];
            ptr = ((ptr-14+30)%30);
            row0 = col3 = aes_style_table0[(byte)(m_state[(ptr+3+60)%30])];
            col3 ^= row1 = aes_style_table1[(byte)(m_state[(ptr+3+60)%30]>>8)];
            col3 ^= row2 = aes_style_table2[(byte)(m_state[(ptr+3+60)%30]>>16)];
            col3 ^= aes_style_table3[(byte)(m_state[(ptr+3+60)%30]>>24)];
            col0 = aes_style_table0[(byte)(m_state[(ptr+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[(ptr+60)%30]>>8)];
            row1 ^= tmp;
            col0 ^= tmp;
            tmp = aes_style_table2[(byte)(m_state[(ptr+60)%30]>>16)];
            row2 ^= tmp;
            col0 ^= tmp;
            col0 ^= row3 = aes_style_table3[(byte)(m_state[(ptr+60)%30]>>24)];
            row0 ^= col1 = aes_style_table0[(byte)(m_state[(ptr+1+60)%30])];
            col1 ^= aes_style_table1[(byte)(m_state[(ptr+1+60)%30]>>8)];
            tmp = aes_style_table2[(byte)(m_state[(ptr+1+60)%30]>>16)];
            row2 ^= tmp;
            col1 ^= tmp;
            tmp = aes_style_table3[(byte)(m_state[(ptr+1+60)%30]>>24)];
            row3 ^= tmp;
            col1 ^= tmp;
            row0 ^= col2 = aes_style_table0[(byte)(m_state[(ptr+2+60)%30])];
            tmp = aes_style_table1[(byte)(m_state[(ptr+2+60)%30]>>8)];
            row1 ^= tmp;
            col2 ^= tmp;
            col2 ^= aes_style_table2[(byte)(m_state[(ptr+2+60)%30]>>16)];
            tmp = aes_style_table3[(byte)(m_state[(ptr+2+60)%30]>>24)];
            row3 ^= tmp;
            col2 ^= tmp;
            col_0 = (uint)col0^((ulong)col2<<32);
            col_1 = (uint)col1^((ulong)col3<<32);
            col_2 = (uint)col2^((ulong)col0<<32);
            col_3 = (uint)col3^((ulong)col1<<32);
            col_02 = ((row0^col_0)&0x000000ff000000ff)^((row1^col_1)&0x0000ff000000ff00)^((row2^col_2)&0x00ff000000ff0000)^((row3^col_3)&0xff000000ff000000);
            row0=row0>>8;
            row1=row1>>8;
            row2=row2>>8;
            row3=row3<<24;
            col_13 = ((row0^col_1)&0x000000ff000000ff)^((row1^col_2)&0x0000ff000000ff00)^((row2^col_3)&0x00ff000000ff0000)^((row3^col_0)&0xff000000ff000000);
            tmp_zero = (uint) col_02;
            m_state[(ptr+2+60)%30] = (uint)(col_02>>32);
            m_state[(ptr+1+60)%30] = (uint)col_13;
            m_state[(ptr+3+60)%30] = (uint)(col_13>>32);
            m_state[(ptr+60)%30] = tmp_zero;
        } 

        m_state[(ptr+4+60)%30] ^=m_state[(ptr+60)%30];
        m_state[(ptr+15+60)%30] ^=m_state[(ptr+60)%30];

        byte* result = new byte[HashSize];

        for (int j=0; j<4; j++)
        {
            ((uint*)result)[j] = m_state[(ptr+1+j+60)%30];

            if ((j == 3)&& (HashSize == 28))
                continue;

            ((uint*)result)[4+j] = m_state[(ptr+15+j+60)%30];
        }

        return result;
    }
}